package com.loongtech.bi.entity.player;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "back_mac_30day")
public class EntityBackDevice30Day implements Serializable {
	private static final long serialVersionUID = 2L;
	@Id
	private Date day; // 日期
	@Id
	private String serverid;
	@Id
	private String channelid;
	@Id
	private String platformid;
	@Column(columnDefinition = "int(11) NOT NULL default 0")
	private Integer macOldUser;
	@Column(columnDefinition = "int(11) NOT NULL default 0")
	private Integer macNewUser;
	@Column(columnDefinition = "int(11) NOT NULL default 0")
	private Integer activeOldUserMacs;
	@Column(columnDefinition = "int(11) NOT NULL default 0")
	private Integer activeNewUserMacs;
	@Column(columnDefinition = "decimal(6,4) default 0.0000")
	private double oldUserMacRate;
	@Column(columnDefinition = "decimal(6,4) default 0.0000")
	private double newUserMacRate;

	public Date getDay() {
		return day;
	}

	public void setDay(Date day) {
		this.day = day;
	}

	public String getPlatformid() {
		return platformid;
	}

	public void setPlatformid(String platformid) {
		this.platformid = platformid;
	}

	public Integer getMacOldUser() {
		return macOldUser;
	}

	public void setMacOldUser(Integer macOldUser) {
		this.macOldUser = macOldUser;
	}

	public Integer getMacNewUser() {
		return macNewUser;
	}

	public void setMacNewUser(Integer macNewUser) {
		this.macNewUser = macNewUser;
	}

	public Integer getActiveOldUserMacs() {
		return activeOldUserMacs;
	}

	public void setActiveOldUserMacs(Integer activeOldUserMacs) {
		this.activeOldUserMacs = activeOldUserMacs;
	}

	public Integer getActiveNewUserMacs() {
		return activeNewUserMacs;
	}

	public void setActiveNewUserMacs(Integer activeNewUserMacs) {
		this.activeNewUserMacs = activeNewUserMacs;
	}

	public double getOldUserMacRate() {
		return oldUserMacRate;
	}

	public void setOldUserMacRate(double oldUserMacRate) {
		this.oldUserMacRate = oldUserMacRate;
	}

	public double getNewUserMacRate() {
		return newUserMacRate;
	}

	public void setNewUserMacRate(double newUserMacRate) {
		this.newUserMacRate = newUserMacRate;
	}
	
	public String getServerid() {
		return serverid;
	}

	public void setServerid(String serverid) {
		this.serverid = serverid;
	}

	public String getChannelid() {
		return channelid;
	}

	public void setChannelid(String channelid) {
		this.channelid = channelid;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((day == null) ? 0 : day.hashCode());
		result = prime * result + ((platformid == null) ? 0 : platformid.hashCode());
		result = prime * result + ((channelid == null) ? 0 : channelid.hashCode());
		result = prime * result + ((serverid == null) ? 0 : serverid.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null || getClass() != obj.getClass()) {
			return false;
		}

		EntityBackDevice30Day o = (EntityBackDevice30Day) obj;
		if (day == null && o.day != null || null != day && !day.equals(o.day)) {
			return false;
		}
		if (platformid == null && o.platformid != null || null != platformid && !platformid.equals(o.platformid)) {
			return false;
		}
		if (channelid == null && o.channelid != null || null != channelid && !channelid.equals(o.channelid)) {
			return false;
		}
		if (serverid == null && o.serverid != null || null != serverid && !serverid.equals(o.serverid)) {
			return false;
		}
		return toString().equals(o.toString());
	}

	@Override
	public String toString() {
		return "EntityBackDevice30Day [day=" + day + ", serverid=" + serverid + ", channelid=" + channelid
				+ ", platformid=" + platformid + ", macOldUser=" + macOldUser + ", macNewUser=" + macNewUser
				+ ", activeOldUserMacs=" + activeOldUserMacs + ", activeNewUserMacs=" + activeNewUserMacs
				+ ", oldUserMacRate=" + oldUserMacRate + ", newUserMacRate=" + newUserMacRate + "]";
	}
}
